package cn.jinjimi.framework.pay;

import android.app.Activity;
import android.content.Context;

import javax.annotation.Nullable;

/**
 *
 * @author zhenhua
 */
public class PayManager {

    private PayManager() {

    }

    @Nullable
    public static AbstractPayTask newPayTask(Context context, int type) {
        if (context instanceof Activity) {
            return newPayTask((Activity) context, type);
        }
        return null;
    }

    @Nullable
    public static AbstractPayTask newPayTask(Activity activity, int type) {
        switch (type) {
            case IPayType.ALIPAY:
                return new AliPayTask(activity);
            case IPayType.WECHAT:
                return new WXPayTask(activity);
            default:break;
        }
        return null;
    }

}
